<%--
  Author: chengwei
  Date: 2016/9/20
  Time: 16:23
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="/resource/js/jquery.min.js"></script>
    <%--<script type="text/javascript" src="/resource/js/esl.js"></script>--%>
    <script type="text/javascript" src="/resource/js/echarts.min.js"></script>
    
</head>
<body>
    <div id="ddd" style="width: 500px;height: 400px;"></div>
    <div id="pi" style="width: 500px;height: 400px;"></div>

</body>
<script type="text/javascript">
    //    var echarts = require('echarts');
    var myChart = echarts.init(document.getElementById('ddd'));
    var option = {
        title: {
            text: 'ECharts 入门示例'
        },
        tooltip: {},
        legend: {
            data: ['销量', '产量']
        },
        yAxis: {
            data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
        },
        toolbox: {
            show: true, feature: {
                dataZoom: {
                    yAxisIndex: 'none'
                },
                dataView: {readOnly: false},
                magicType: {type: ['line', 'bar']},
                restore: {},
                saveAsImage: {}
            }
        },
        xAxis: [{type: 'value', name: '产量'}, {type: 'value', name: '销量'}],
        series: [{
            xAxisIndex: 0,
            name: '销量',
            type: 'bar',
            data: [5, 20, 36, 10, 10, 20]
        }, {
            xAxisIndex: 1,
            name: '产量',
            type: 'bar',
            data: [6, 5, 14, 13, 20, 19]
        }]
    };

    myChart.setOption(option);

    var pi = echarts.init(document.getElementById('pi'));
    pi.setOption({
        series: [
            {
                name: '收入',
                type: 'pie',
                radius: '100px',
                data: [
                    {value: 3000, name: '小学'},
                    {value: 4000, name: '初中'},
                    {value: 5000, name: '高中'},
                    {value: 6000, name: '大学'},
                    {value: 7000, name: '研究生'},
                    {value: 8000, name: '博士'}
                ]
            }
        ],
        toolbox: {
            show: true,
            feature: {
                mark: {show: true},
                dataView: {show: true, readOnly: false},
                magicType: {
                    show: true,
                    type: ['pie', 'funnel'],
                    option: {
                        funnel: {
                            x: '25%',
                            width: '50%',
                            funnelAlign: 'left',
                            max: 1548
                        }
                    }
                },
                restore: {show: true},
                saveAsImage: {show: true}
            }
        },
        calculable: true,
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        }

    });
</script>
</html>
